package com.bbc.yuntun.common.core.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.google.common.collect.Maps;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.util.Map;
import java.util.Objects;

/**
 * 基本参数类
 *
 * @author liac
 * @date 2022/4/25 10:00
 */
@Data
public class BaseParam implements Serializable {

    /** 请求参数 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @Schema(description = "请求参数")
    @TableField(exist = false)
    protected Map<String, Object> params;

    /** 搜索值 */
    @JsonIgnore
    @Schema(description = "搜索值")
    @TableField(exist = false)
    protected String searchValue;

    public Map<String, Object> getParams() {
        if (Objects.isNull(params)) {
            params = Maps.newHashMap();
        }
        return params;
    }

}
